﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="Single.aspx.cs" Inherits="Token.Piker.Web.Single" %>
<%@ Register TagPrefix="uc" TagName="ucHead" Src="~/uc/head.ascx" %>
<%@ Register TagPrefix="uc" TagName="ucFoot" Src="~/uc/foot.ascx" %>
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
    <title>皮壳网--个人单张</title>
        <link rel="stylesheet" type="text/css" href="../css/singlePhoto.css"/>
        <script type="text/javascript" src="../js/autoTextarea.js"></script>
        <link href="../js/fancyapps-fancyBox/source/jquery.fancybox.css" rel="stylesheet" type="text/css" />
        <link href="../css/login.css" rel="stylesheet" type="text/css" />
    <script src="../js/fancyapps-fancyBox/lib/jquery-1.9.0.min.js" type="text/javascript"></script>
        <script src="../js/fancyapps-fancyBox/source/jquery.fancybox.pack.js" type="text/javascript"></script>
    <script src="../js/jQuery.autoIMG.min.js" type="text/javascript"></script>
        <script src="../js/jQuery.autoIMG.js" type="text/javascript"></script>
</head>
<body>
<!---头部--->
	 <uc:ucHead ID="ucHeader" runat="server" />
<!---头部结束--->
	 <form id="form1" runat="server">
<!---正文--->
    <div class="containe_box fix">
			<div class="big_pho fix">
				<div id="ll_big" class="side_big prev"><img src="../Images/prevnext.png" /></div>
				<div class="t_big hidden"><img   alt="large_pl" src="../Images/zuo.png" /></div>
				<div id="large_pic_box" class="t_big"><a href="" target="_blank"><img id="large_pic" alt="large_pic" src="" /></a></div>
				<div class="t_big hidden"><img  alt="large_pr" src="../Images/you.png" /></div>
				<div id="lr_big" class="side_big next"><img  src="../Images/prevnext.png" /></div>
			</div>
            <div id ="exif" class="exif">
                <span class="exif_desc">制造厂商</span><span id="Make" class="exif_cont">	……</span>
                <span class="exif_desc">相机型号</span><span id="Model"  class="exif_cont">…………</span>
                <span class="exif_desc">相机软件</span><span id="Software"  class="exif_cont">正常（upper-left）</span>
                <span class="exif_desc">曝光时间</span><span id="ExposureTime"  class="exif_cont">0.00800 (1/125) sec</span><br />
                <span class="exif_desc">光圈值</span><span id="FNumber"  class="exif_cont">F1.6</span>
                <span class="exif_desc">曝光程序</span><span id="ExposureProgram"  class="exif_cont">（EV+-）	0</span>
                <span class="exif_desc">感光度</span><span id="ISO"  class="exif_cont">点测光 (Spot)</span>
                <span class="exif_desc">曝光补偿</span><span id="ExposureBiasValue"  class="exif_cont">光圈优先</span><br />
                <span class="exif_desc">白平衡</span><span id="Lightsource"  class="exif_cont">100</span>
                <span class="exif_desc">测光模式</span><span id="MeteringMode"  class="exif_cont">30,32,32,31</span>
                <span class="exif_desc">Exif版本</span><span id="ExifVersionExif"  class="exif_cont">2</span>
            </div>
		</div>	
	<div class="main_box">
	<div class="containe fix">
		
		<div class="like fix">
			<div class="like_left">
				<div class="like_l"></div>
				<div class="like_m fix">
					<div class="njh">
						<span class="singlePname" id="PhotoName">宁静海</span>
						<span class="block">@ <a href="#" id="Position">福建 厦门</a></span>
					</div>
					<div class="des">
						<span class="miao">描述：</span>
						<span class="miao_nei"><a href="#Descrip" title="" id="Descrip">那年夏天宁静的海</a></span>
					</div>
					<div class="upload fix">
                        <img src="<%=UserPic%>" width="55" height="55"/> 
                        <div class="shuyu">
						    <ul >
                                <li>
                                    <a href="Single.aspx?UID=<%=UID %>" target="_blank"><font color="33c377"> <%=UserName %></font> </a>上传于  
                                    <a href="#time" ><span id="UpLoadTime"> 2012年8月18日</span></a>
                                    <a id="id_exif" href="#exif_info">更多exif信息</a>
                                </li>
							    <li>属于 <a href="#"><font color="33c377"> 风景 </font></a> 分类</li>
						    </ul>
                        </div>
					</div>
				</div>
				<div class="like_r"></div>
			</div>
			<div class="like_right">
                <div class="like_l"></div>
                <div class="xh_box">
				<span class="hreat"><img src="../Images/hreat.png" align="center"/></span>
				<span class="xh"><a id="likecount" href="#Like_Count" class="like_count">喜欢（0）</a></span>
                </div>
                <div class="like_r"></div>
			</div>
            
		</div>
		<div class="pho_list fix">
			<div class="like_le"></div>
			<div class="like_mid fix" id="mini_pic">
				<ul>
                    <asp:Repeater ID="Single_pic" runat="server">
                        <ItemTemplate>
                            <li ><a href="#pic_1"><img id="<%#Eval("ID").ToString() %>" src="<%#"/AJAX/Thumbnail.ashx?pid="+Eval("ID").ToString()+"&width=100&height=100" %>" alt="<%#Eval("Descrip") %>" /></a></li>
                        </ItemTemplate>
                    </asp:Repeater>
				</ul>
				<div class="arrow fix">
					<ul>
						<li><a href="#pic_pre"><img src="../Images/zjt.png"/></a></li>
						<li ><span title="pic_index"></span><span id="picNum">/<%=picNum%></span></li>
						<li><a href="#pic_next"><img src="../Images/yjt.png"/></a></li>
					</ul>
				</div>
			</div>
			<div class="like_ri"></div>
		</div>
		<div class="comment fix">
			<div class="comment_l fix">
				<div  class="ping"><font size="5" color="#a9a9a9">评论</font></div>
				<div class="cmt_1 fix">
					<div class="cmt_ll">
						<ul>
							<li><img src="<%=pUserPic%>" width="55" height="55"/></li>
							<li id="name"> <%=pUserName %></li>
						</ul>
					</div>
					<div id="Pcontent" class="cmt_l2">
                        <textarea id="text" rows="3" cols="70"  style="resize: none; max-height: none; overflow-y: hidden;line-height:16px;"></textarea>
                        <a href="#comment"><img src="../Images/fabiao.jpg" id="bt" alt="点我发表！" /></a>
                        <script type="text/javascript">
                            var text = document.getElementById("text");
                            autoTextarea(text);// 调用
                        </script>
					</div>
				</div>
                <div id="comment_list">
				
                </div>
			</div>
			<div class="comment_r">
				<ul>	
					<li>分享此照片到：</li>
                    </ul>
                <ul>
					<li><a href="#"><img src="../Images/ren.png" /></a></li>
					<li><a href="#"><img src="../Images/kong.png" /></a></li>
					<li><a href="#"><img src="../Images/lang.png" /></a></li>
					<li><a href="#"><img src="../Images/teng.png" /></a></li>
				</ul>
			</div>
		</div> 
	</div>
	</div>
<!---正文结束--->
 </form>
    <uc:ucFoot ID="ucFooter" runat="server" />
    
<!---登录区域--->
    <div id="div_login" style="display: none">
        <div id="div_login_title">
            <h2>登录到皮壳网</h2>
        </div>
        <div id="login_content">
            <p>
                <label for="userName">
                    用户名：</label>
                <input class="text" type="text" name="username" id="username" />
            </p>
            <p>
                <label for="password">
                    密码：</label>
                <input class="text" type="password" name="password" id="password" />
            </p>
            <p>
                <input class="button" type="button" value="登录" id="btnSubmit" />
                <a id="anchor_create_account" href="Register.aspx">没有账号？立即注册</a>
            </p>
        </div>
    </div>
    <!---登录区域结束--->
    
    
    <script  type="text/javascript" src ="js/JsonScript.js"></script>        
    <script src="../js/login.js" type="text/javascript"></script>
    <script type="text/javascript">
        //var jQuery = $.noConflict(true);
        var $largeImg_width = 840;
        var $largeImg_height = 432;
        var $smallImg_width = 100;
        var $smallImg_height = 100;

        var uid = $("li[id=u_id]").attr("title");
        var $user_name = $("#name").val();
        var $comment_area = $("#Pcontent").find("textarea");
        /// <summary>
        /// 将Json序列化的时间由/Date(1294499956278+0800)转为字符串
        /// </summary>
        function ChangeDateFormat(cellval) {
            var date = new Date(parseInt(cellval.replace("/Date(", "").replace(")/", ""), 10));
            var month = date.getMonth() + 1 < 10 ? "0" + (date.getMonth() + 1) : date.getMonth() + 1;
            var day = date.getDate() < 10 ? "0" + date.getDate() : date.getDate();
            var hour = date.getHours() < 10 ? "0" + date.getHours() : date.getHours();
            var minute = date.getMinutes() < 10 ? "0" + date.getMinutes() : date.getMinutes();
            //var second = date.getSeconds() < 10 ? "0" + date.getSeconds() : date.getSeconds();
            return date.getFullYear() + "年" + month + "月" + day + "日   " + hour + ":" + minute;//+ ":" + second;
        }
        //初始加载
        $(document).ready(function ($) {
            //显示exif信息
            $("a[id=id_exif]").mouseover(function () {
                $("#exif").fadeTo(600, 0.6);
            });
            $("a[id=id_exif]").mouseout(function () {
                $("#exif").fadeTo(600, 0);
            });
            
            //喜欢
            $("a[id=likecount]").click(function () {
                if (Page.IsLogin == "TRUE") {
                    var img_id = $("img[alt=large_pic]").attr("id");
                    SubmitLikeNum(img_id);
                } else {
                    alert("喜欢无效！请先登录！");
                }
                //$("#exif").fadeTo(600, 0);
            });
            //评论
            $("img[id=bt]").click(function () {
                var $img_id = $("img[alt=large_pic]").attr("id");
                var $content = $comment_area.val().replace(/</g, '&lt;').replace(/>/g, '&gt;');
                SubmitComment($img_id, "44", $content,$user_name);
            });
            //alert("First?");
            var $li_list = $("#mini_pic ul:eq(0) li");
            $li_list.each(function () {
                $(this).children("a").attr("href", "#pic_" + ($(this).index() + 1).toString());
                $(this).removeClass("current");
            });
            $li_list.eq(0).addClass( "current");
            $li_list.eq(8).addClass("hidden");
            $li_list.eq(9).addClass("hidden");
            $li_list.eq(10).addClass("hidden");
            $li_list.eq(11).addClass("hidden");
            $("span[title=pic_index]").html("1");//当前选择图片序列
            //大图片
            
            var parm_pre ;
            var parm_cur = { "Id_person": uid, "Id_img": $li_list.eq(0).find("img").attr("id"), "success": "true" };
            var parm_next = { "Id_person": uid, "Id_img": $li_list.eq(1).find("img").attr("id"), "success": "true" };
            showlarge(parm_pre, parm_cur, parm_next);
            //picMidAdjust("#large_pic_box", 1024);
            $("#large_pic_box").autoIMG();
            $("#mini_pic ul li a").autoIMG();
        })
        //图片居中方法
        function picMidAdjust(box, boxWidth) {
            $("img").load(function () {
                $(box).find("img").each(function () {
                    var img = new Image();
                    img.src = $(box).find("img").attr("src");
                    if (img.width > 0 && img.width < boxWidth) {
                        $(box).find("img").css("margin-left", (boxWidth - img.width) / 2);
                    }
                    else {
                        $(box).find("img").css("margin-left", 0);
                    }
                });
            });
        }
        //显示大图片方法
        function showlarge(parm_pre, parm_cur, parm_next) {
            var par_pre = jQuery.toJSON(parm_pre);
            var par_cur = jQuery.toJSON(parm_cur);
            var par_next = jQuery.toJSON(parm_next);
            $.ajax({
                url: "../AJAX/Single.ashx",
                type: 'POST',
                data: { imgInfo_pre: par_pre, imgInfo_cur: par_cur, imgInfo_next: par_next, f_id: "SLI" },//tparm,
                dataType: "json",
                success: function (json) {
                    if (json[1].CompressUrl_2 != "") {
                        if (json[0] != null) {
                            $("img[alt=large_pl]").attr("id", json[0].ID);
                            $("img[alt=large_pl]").attr("src","../AJAX/Thumbnail.ashx?pid=" +json[0].ID+"&width="+$largeImg_width+"&height="+$largeImg_height);
                        } if (json[1] != null) {
                            //$("img[alt=large_pic]").parent("a").parent("div").hide();
                            $("img[alt=large_pic]").attr("id", json[1].ID);
                            $("img[alt=large_pic]").attr("src", "../AJAX/Thumbnail.ashx?pid=" + json[1].ID + "&width="+$largeImg_width+"&height="+$largeImg_height);
                            $("img[alt=large_pic]").parent("a").attr("href", $("img[alt=large_pic]").attr("src"));
                            //$("img[alt=large_pic]").parent("a").parent("div").slideUp(600);
                            //$("img[alt=large_pic]").parent("a").parent("div").slideDown(600);
                            BindImgInfo(json[1]);
                        } if (json[2] != null) {
                            $("img[alt=large_pr]").attr("id", json[2].ID);
                            $("img[alt=large_pr]").attr("src", "../AJAX/Thumbnail.ashx?pid=" + json[2].ID + "&width=" + $largeImg_width + "&height=" + $largeImg_height);
                        }
                    }
                    else {
                        //$("#result").html("失败");
                        alert("Error!");
                    }
                }
            })
        }
        //绑定大图数据
        function BindImgInfo(img) {
            $("#PhotoName").html(img.PhotoName);
            $("#Position").html(img.Province + " " + img.City);
            $("#Descrip").html(img.Descrip==null?"":(img.Descrip.length > 15 ? img.Descrip.substring(0, 28) + "…" : img.Descrip));
            $("#Descrip").attr("title",img.Descrip);
            $("span[id=UpLoadTime]").html(img.UpLoadTime);
            $("#Make").html(img.Make);
            $("#Model").html(img.Model);
            $("#Software").html(img.Software);
            $("#ExposureTime").html(img.ExposureTime);
            $("#FNumber").html(img.FNumber);
            $("#ExposureProgram").html(img.ExposureProgram);
            $("#ISO").html(img.ISO);
            $("#ExposureBiasValue").html(img.ExposureBiasValue);
            $("#Lightsource").html(img.Lightsource);
            $("#MeteringMode").html(img.MeteringMode);
            $("#ExifVersionExif").html(img.ExifVersionExif);
            $("a[id=likecount]").html("喜欢（"+img.LikeCount+"）");
            //评论
            PcommentBind(img.ID);
        }
        //照片评论加载
        function PcommentBind(img_ID) {
            $.ajax({
                url: "../AJAX/Single.ashx",
                type: 'POST',
                data: { photo_ID:img_ID, f_id: "PCB" },//tparm,
                dataType: "json",
                success: function (json) {
                    $("#comment_list").empty();
                    if (json != null) {
                        for (var i = 0; i < json.length; i++) {
                            //var $usename = GetUserName(json[i].UserID);
                            //alert($usename);
                            $("<div class='comment_ls fix'><div class='cmt_ll fix'><img src='" + json[i].UserPic + "' width='55px' height='55px' /></div><div class='reply'><ul><li><span id='names'>" + json[i].UserName + "</span>" + ChangeDateFormat(json[i].PComment.CommentTime) + "</li><li>" + json[i].PComment.Content + "</li><li><a href='#'>回复</a></li></ul>	</div></div>").appendTo("#comment_list");
                            //alert("first?");
                        }
                    }
                }
            })
        }
     
        //预加载缩略图方法
        function PreLoadImg(cur_index,scroll_way) {
            $.ajax({
                url: "../AJAX/Single.ashx",
                type: 'POST',
                data: { curImg_index: cur_index, way: scroll_way, f_id: "PLI" },//tparm,
                dataType: "json",
                success: function (json) {
                    if (scroll_way == "L") {
                        if (json != null) {
                            var $li_list = $("#mini_pic ul:eq(0) li");
                            //图片预加载
                            if ($li_list.length == 12) {//初始图片数为12条
                                for (var i = 8; i < 12; i++) {
                                    $li_list.eq(i).find("img").attr("id", json[i - 8].ID);
                                    $li_list.eq(i).find("img").attr("src", "../AJAX/Thumbnail.ashx?pid=" + json[i - 8].ID + "&width="+$smallImg_width+"&height="+$smallImg_height);
                                }
                            }
                            else {//小于12条
                                for (var i = 8; i < $li_list.length; i++) {
                                    $li_list.eq(i).find("img").attr("id", json[i - 8].ID);
                                    $li_list.eq(i).find("img").attr("src", "../AJAX/Thumbnail.ashx?pid=" + json[i - 8].ID + "&width=" + $smallImg_width + "&height=" + $smallImg_height);
                                }
                            }
                        }
                        else {
                            //$("#result").html("失败");
                            alert("Lmini Error!");
                        }
                    } else if (scroll_way == "R") {
                        if (json != null) {
                            var $li_list = $("#mini_pic ul:eq(0) li");
                            //图片预加载
                            for (var i = 11; i >= json.Listcount; i--) {
                                $li_list.eq(i).find("img").attr("id", $li_list.eq(i - json.Listcount).find("img").attr("id"));
                                $li_list.eq(i).find("img").attr("src", $li_list.eq(i - json.Listcount).find("img").attr("src"));
                            }
                            for (var i = 0; i < json.Listcount; i++) {
                                $li_list.eq(i).find("img").attr("id", json.ImgList[i].ID);
                                $li_list.eq(i).find("img").attr("src", "../AJAX/Thumbnail.ashx?pid=" + json.ImgList[i].ID + "&width=" + $smallImg_width + "&height=100" + $smallImg_height);
                            }
                            //更改序列
                            $li_list.each(function () {
                                var $li_a_href = $(this).children("a").attr("href");
                                $(this).children("a").attr("href", "#pic_" + (parseInt($li_a_href.substring(5, $li_a_href.toString().length)) - json.Listcount).toString());
                                //alert($(this).children("a").attr("href"));//test
                                $(this).removeClass("current");
                            });
                            $li_list.eq(json.Listcount ).addClass("current");
                            
                            //$("img[id=" + $("img[alt=large_pl]").attr("id") + "]").parent("a").parent("li").addClass("current");
                        }
                        else {
                            //$("#result").html("失败");
                            alert("Rmini Error!");
                        }
                    }
                }
            })
        }
        //图片滚动
        function RollLeft(img_id) {
            var $li_list = $("#mini_pic ul:eq(0) li");
            //图片左滚
            var $scrollNum = 0;
            for (var j = 0; j < $li_list.length-8; j++) {
                if ($li_list.eq(8).find("img").attr("id").toString() != "0") {
                    for (var i = 0; i < 12; i++) {
                        $li_list.eq(i).find("img").attr("id", $li_list.eq(i + 1).find("img").attr("id"));
                        $li_list.eq(i).find("img").attr("src", $li_list.eq(i + 1).find("img").attr("src"));
                    }
                    $scrollNum++;
                }
            }
            //修改li的图片序列
            $li_list.each(function () {
                var $li_a_href = $(this).children("a").attr("href");
                $(this).children("a").attr("href", "#pic_" + (parseInt($li_a_href.substring(5, $li_a_href.toString().length)) + $scrollNum).toString());
                //alert($(this).children("a").attr("href"));//test
                $(this).removeClass("current");
            });
            //选中当前已选的图片
            $("img[id="+img_id+"]").parents("li").addClass( "current");//当前选择
            //$("img[id=" + $("img[alt=large_pl]").attr("id") + "]").parent("a").parent("li").addClass("current");
            //预加载后四图片
            var $img_cur_a_href = $("img[id=" + img_id + "]").parent("a").attr("href");
            PreLoadImg($img_cur_a_href.substring(5,$img_cur_a_href.toString().length),"L");
        }
        function RollRight(img_id) {
            //alert("Yes!");
            var $img_cur_a_href = $("img[id=" + img_id + "]").parent("a").attr("href");
            PreLoadImg($img_cur_a_href.substring(5, $img_cur_a_href.toString().length), "R");
        }
        //缩略图是否滚动加载
        function Rolling(li_index, img_id) {
            if (li_index == 7) {
                $img_a_href = $("#mini_pic ul:eq(0) li[class=current]").find("a").attr("href");
                var $img_index = $img_a_href.substring(5, $img_a_href.length);//获取当前选择图片序列
                var $total = $("#picNum").html().substring(1, $("#picNum").html().length);
                if ($img_index != $total) {
                    RollLeft(img_id);
                }
            }
            if (li_index == 0) {
                $img_a_href = $("#mini_pic ul:eq(0) li[class=current]").find("a").attr("href");
                var $img_index = $img_a_href.substring(5, $img_a_href.length);//获取当前选择图片序列
                if ($img_index != 1) {
                    RollRight(img_id);
                }
            }
        }
        //为缩略图绑定click方法
        $("#mini_pic  ul:eq(0) img").bind({
            click: function () {
                var li_list = $("#mini_pic ul:eq(0) li");//缩略图li序列
                li_list.each(function () {
                    //$(this).attr("class", "");//class设为空
                    $(this).removeClass("current");//class设为空
                });
                $(this).parents("li").addClass("current");//当前选择
                var $img_id = $(this).attr("id");//获取当前选择图片ID
               // $select_img_id = $img_id;
                //$("img[id=" + $select_img_id + "]").parent("a").parent("li").addClass("current");
                var $img_index = $(this).parent("a").attr("href").substring(5, $(this).parent("a").attr("href").length );//获取当前选择图片序列
                $("span[title=pic_index]").html($img_index );//当前选择图片序列
                var parm_cur = { "Id_person": uid, "Id_img": $img_id, "success": "true" };
                var $li_index = $(this).parents("li").index();//当前li索引
                var $id_pre, $id_next, parm_pre, parm_next;
                //前一个
                if ($li_index > 0 && $li_index <8) {
                    var $id_pre = $(this).parents("li").prev("li").find("img").attr("id");//获取当前选择图片ID
                    //$id_pre = $path_pre.substring($path_pre.length - 6, $path_pre.length - 4);//获取当前选择图片ID
                    parm_pre = { "Id_person": uid, "Id_img": $id_pre,"success": "true" };
                }
                //后一个
                if ($li_index < 8 && $li_index > -1) {
                    var $id_next = $(this).parents("li").next("li").find("img").attr("id");//获取当前选择图片路径
                    //$id_next = $path_next.substring($path_next.length - 6, $path_next.length - 4);//获取当前选择图片ID
                    parm_next = { "Id_person": uid, "Id_img": $id_next, "success": "true" };
                }
                showlarge(parm_pre, parm_cur, parm_next);
                Rolling($li_index, $img_id);
                picMidAdjust("#large_pic_box", 1024);
            }
        });
        //右滚图片
        $("#lr_big").bind({
            click: function () {
                var $img_index = $("#mini_pic ul:eq(0) li[class=current]").index();
                var $img_id = $("#mini_pic ul:eq(0) li:eq(" + ($img_index + 1) + ")").find("img").attr("id");
                if ($img_id != null && $img_id.toString() != "" && $img_id.toString() != "0") {
                    $("#mini_pic ul:eq(0) li:eq(" + $img_index + ")").removeClass("current");//class设为空
                    $("#mini_pic ul:eq(0) li:eq(" + ($img_index + 1) + ")").addClass("current");//当前选择
                    Rolling(($img_index + 1), $img_id);
                    var parm_pre;
                    //var parm_cur = { "Id_person": "2", "Id_img": $("#mini_pic ul:eq(0) li.current").find("img").attr("id"), "success": "true" };
                    var parm_cur = { "Id_person": uid, "Id_img": $img_id, "success": "true" };
                    var parm_next;
                    showlarge(parm_pre, parm_cur, parm_next);
                    $img_a_href = $("#mini_pic ul:eq(0) li[class=current]").find("a").attr("href");
                    var $img_index = $img_a_href.substring(5, $img_a_href.length);//获取当前选择图片序列
                    $("span[title=pic_index]").html($img_index);//当前选择图片序列
                }
            },
            mouseover: function () {
                $(this).find("img").css("margin-top",-92);
            },
            mouseout: function () {
                $(this).find("img").css("margin-top", 0);
            }
        });
        //左滚图片
        $("#ll_big").bind({
            click: function () {
                var $img_index = $("#mini_pic ul:eq(0) li[class=current]").index();
                var $img_id = $("#mini_pic ul:eq(0) li:eq(" + ($img_index -1) + ")").find("img").attr("id");
                if ($img_id != null && $img_id.toString() != "" && $img_id.toString() != "0") {
                    $("#mini_pic ul:eq(0) li:eq(" + $img_index + ")").removeClass("current");//class设为空
                    $("#mini_pic ul:eq(0) li:eq(" + ($img_index -1) + ")").addClass("current");//当前选择
                    Rolling(($img_index -1), $img_id);
                    var parm_pre;
                    //var parm_cur = { "Id_person": "2", "Id_img": $("#mini_pic ul:eq(0) li.current").find("img").attr("id"), "success": "true" };
                    var parm_cur = { "Id_person": uid, "Id_img": $img_id, "success": "true" };
                    var parm_next;
                    showlarge(parm_pre, parm_cur, parm_next);
                    $img_a_href = $("#mini_pic ul:eq(0) li[class=current]").find("a").attr("href");
                    var $img_index = $img_a_href.substring(5, $img_a_href.length);//获取当前选择图片序列
                    $("span[title=pic_index]").html($img_index);//当前选择图片序列
                }
            },
            mouseover: function () {
                $(this).find("img").css("margin-top", -92);
            },
            mouseout: function () {
                $(this).find("img").css("margin-top", 0);
            }
        });
        //上一组图片
        $("#mini_pic  ul:eq(1) img:eq(0)").bind({
            click: function () {
                var $img_id = $("#mini_pic ul:eq(0) li:eq(0)").find("img").attr("id");
                var $img_a_href = $("#mini_pic ul:eq(0) li:eq(0)").find("a").attr("href");
                Rolling(0, $img_id);
                var parm_pre;
                //var parm_cur = { "Id_person": "2", "Id_img": $("#mini_pic ul:eq(0) li.current").find("img").attr("id"), "success": "true" };
                var parm_cur = { "Id_person": uid, "Id_img": $img_id, "success": "true" };
                var parm_next ;
                showlarge(parm_pre, parm_cur, parm_next);
                var $img_index = $img_a_href.substring(5, $img_a_href.length);//获取当前选择图片序列
                $("span[title=pic_index]").html($img_index);//当前选择图片序列
            }
        });
        //下一组图片
        $("#mini_pic  ul:eq(1) img:eq(1)").bind({
            click: function () {
                var $img_id = $("#mini_pic ul:eq(0) li:eq(7)").find("img").attr("id");
                Rolling(7, $img_id);
                var parm_pre;
                var parm_cur = { "Id_person":uid, "Id_img": $("#mini_pic ul:eq(0) li.current").find("img").attr("id"), "success": "true" };
                var parm_next;
                showlarge(parm_pre, parm_cur, parm_next);
                var $img_index = $("#mini_pic ul:eq(0) li.current").find("a").attr("href").substring(5, $("#mini_pic ul:eq(0) li.current").find("a").attr("href").length);//获取当前选择图片序列
                $("span[title=pic_index]").html($img_index);//当前选择图片序列
            }
        });
        //显示喜欢数据
        function SubmitLikeNum(img_id) {
            $.ajax({
                url: "../AJAX/Single.ashx",
                type: 'POST',
                data: { photo_ID: img_id,user_ID:uid, f_id: "SLN" },//tparm,
                dataType: "json",
                success: function (json) {
                    if (json != null && json.success == "true") {
                        $("a[id=likecount]").html("喜欢（" + json.Id_img + "）");
                        alert("您已成功喜欢这张图片！");
                    }
                    else {
                        alert("操作失败，请重试！");
                    }
                }
            })
        }
        //评论
        function SubmitComment(img_id, user_id, content,user_name) {
            //if (user_name != null && user_name != "" && user_name != "游客")
            if (Page.IsLogin=="TRUE") {
                if (content != null && content != "" && content != "在此写下您的评论，Ctrl+Enter快速发表") {
                    $.ajax({
                        url: "../AJAX/Single.ashx",
                        type: 'POST',
                        data: { Photo_ID: img_id, User_ID: user_id, Content: content, f_id: "SCO" },//tparm,
                        dataType: "json",
                        success: function (json) {
                            if (json != null && json.success == "true") {
                                alert("评论成功提交！");
                                PcommentBind(json.Id_img);
                            }
                            else {
                                alert("操作失败，请重试！");
                            }
                        }
                    })
                } else {
                    alert("内容不能为空，请输入评论内容！");
                }
            }
            else {
                alert("请先登录再评论！" + Page.IsLogin);
            }
        }


    </script>

</body>
</html>


